
#include "stdafx.h"
#include "Player.h"
#include "PlayerFactory.h"


PlayerFactory::PlayerFactory()
{
	m_pPlayerPool		= new CMemoryPoolFactory<Player>;

}

PlayerFactory::~PlayerFactory()
{
	delete m_pPlayerPool;
}

VOID PlayerFactory::Release()
{
	m_pPlayerPool->Release();
}

VOID PlayerFactory::Init( DWORD dwSize )
{
	m_pPlayerPool->Initialize( dwSize, dwSize/2+1 );
}

Player* PlayerFactory::Alloc()
{
	Player *pPlayer = m_pPlayerPool->Alloc();
	//init
	return pPlayer;
}

VOID PlayerFactory::Free(Player* pPlayer )
{
	m_pPlayerPool->Free(pPlayer);
}

